<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
</html>
<script>
     //Vue构造函数
     function Vue(){

     }
     //原型方法
     Vue.prototype.$on = function(){
        console.log('$on')
     }

     Vue.prototype.$emit = function(){
        console.log('$emit')
     }

     //如果是Vue类的实例，才可以找原型借用方法
    let VM  = new Vue;
    VM.$on();
    VM.$emit();

    //组件实例:在Vue框架中VueComponent类的实例是可以借用$on与$emit方法
    function VueComponent(){

    }
    VueComponent.prototype = new Vue;
    let App = new VueComponent();
    App.$on();

</script>